﻿using NHibernate.Mapping.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IceZero.DataStore.Models
{
    /// <summary>
    /// hilo ,使用一个高/低位算法来高效的生成int类型的标识符。给定一个表和字段
    /// （默认分别是是hibernate_unique_key 和next_hi）作为高位值得来源。
    /// 高/低位算法生成的标识符只在一个特定的数据库中是唯一的。在用户自行提供的连接中，不要使用这种生成器。
    /// 你可以使用where参数来指定表里面用了多少列数据， 
    /// You can use the "where" parameter to specify the row to use in a table.This is useful 
    /// if you want to use a single tabel for your identifiers, with different rows for each table.
    /// </summary>
    [Class(Table = "IceZeroTest_HiloMode")]
    public class HiloModeModel 
    {
        [Id(0, Name = "Id", TypeType = typeof(int),Length = 11)]
        [Key(1)]
        [Generator(2, Class = "hilo")]
        public virtual int Id { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Property(Column = "CreateTime", TypeType = typeof(DateTime))]
        public virtual DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 备注
        /// </summary>
        [Property(Column = "Remark", TypeType = typeof(string), Length = 1000)]
        public virtual string Remark { get; set; }
    }
}
